<template>
  <view class="container">
    <!-- 顶部标题 -->
    <view class="header">
      <text class="title">数据维护</text>
    </view>
	
	<view class="data-list">
		<view v-for="(item, rowIndex) in datalist" :key="rowIndex">
			<view class="data-item" @click="goToDetail(item)">
				<text class="data-info data-desc">{{item.classDesc}}</text>
			</view>
		</view>
	</view>		
  </view>
</template>

<script>
export default {
  data() {
    return {
		datalist:[]
    }
  },
  
  created() {
  	this.queryCateGorys();
  },
  
  methods: {
	  queryCateGorys(){
		  this.$api.dataClassAll().then(result => {
		  	if(result && result.code == '200'){
				this.datalist = result.data;
		  	}
		  }).catch(res => {
		  	// 失败进行的操作
		  	uni.showToast({
		  		title: "查询失败!",
		  		duration: 3000
		  	});
		  	return;
		  });
	  },
	  
	  // 跳转到详情页
	  goToDetail(item) {
	  	uni.navigateTo({
	  		url: `/pages/data/dataManage/dataClassDetail?classCode=${item.classCode}&classDesc=${item.classDesc}`,
	  	});
	  },
  }
}
</script>

<style lang="less" scoped>
@import url("@/common/css/list_new.less");
.container {
}

.header {
  padding: 20rpx 20rpx;
  border-bottom: 1rpx solid #eee;
}

.title {
  font-size: 36rpx;
  font-weight: bold;
}

.data-desc{
  font-size: 30rpx;
}
</style>